package cn.hquanheng.java_base.arrayTask;

import org.junit.Test;

public class Scores {
	@Test
	public void Scores() {
		int[][] scores = {
				{11, 12, 13, 14},
				{21, 22, 23, 24},
				{31, 32, 33, 34}
			};
		printScores(scores);
		System.out.println("\n//===============//\n");
		printUpDownScores(scores);
		System.out.println("\n//===============//\n");
		printRotate180(scores);
		System.out.println("\n//===============//\n");
		printCW90(scores);
		
	}
	public static void printScores(int [][]temp){
		for(int i=0;i<temp.length;i++) {
			for(int j=0;j<temp[0].length;j++) {
				System.out.print(temp[i][j]+" ");
			}
			System.out.println();
		}
		
	}
	public static void printUpDownScores(int [][]temp) {
		for(int i=temp.length-1;i>=0;i--) {
			for(int j=0;j<temp[0].length;j++) {
				System.out.print(temp[i][j]+" ");
			}
			System.out.println();
			
		}
		
	}
	public static void printRotate180(int [][]temp) {
		for(int i=temp.length-1;i>=0;i--) {
			for(int j=temp[0].length-1;j>=0;j--) {
				System.out.print(temp[i][j]+" ");
			}
			System.out.println();
			
		}
	}
	public static void printCW90(int [][]temp) {
		for(int i=0;i<temp[0].length;i++) {
			for(int j=temp.length -1;j>=0;j--) {
				System.out.print(temp[j][i]+" ");
			}
			System.out.println();
		}
	}
}
